From 75a5f043526dc3023c2501b6c3e818a6e387c502 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 27 Mar 2012 15:58:22 +0200 Subject: [PATCH] styleproperty: Remove default parse function ... and assert every style property brings its own. --- gtk/gtkcssstyleproperty.c | 16 ++-------------- gtk/gtkcssstylepropertyimpl.c | 4 ++-- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/gtk/gtkcssstyleproperty.c b/gtk/gtkcssstyleproperty.c index 9a3959d582..df8dc09c76 100644 --- a/gtk/gtkcssstyleproperty.c +++ b/gtk/gtkcssstyleproperty.c @@ -274,20 +274,8 @@ gtk_css_style_property_real_parse_value (GtkCssStyleProperty *property, GtkCssParser *parser, GFile *base) { - GValue value = G_VALUE_INIT; - GtkCssValue *result; - - g_value_init (&value, _gtk_css_style_property_get_specified_type (property)); - if (!_gtk_css_style_parse_value (&value, parser, base)) - { - g_value_unset (&value); - return NULL; - } - - result = _gtk_css_value_new_from_gvalue (&value); - g_value_unset (&value); - - return result; + g_assert_not_reached (); + return NULL; } static void diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c index 6303de58a1..66d40d5b50 100644 --- a/gtk/gtkcssstylepropertyimpl.c +++ b/gtk/gtkcssstylepropertyimpl.c @@ -65,6 +65,7 @@ gtk_css_style_property_register (const char * name, GtkCssStyleProperty *node; g_assert (initial_value != NULL); + g_assert (parse_value != NULL); node = g_object_new (GTK_TYPE_CSS_STYLE_PROPERTY, "value-type", value_type, @@ -74,8 +75,7 @@ gtk_css_style_property_register (const char * name, "name", name, NULL); - if (parse_value) - node->parse_value = parse_value; + node->parse_value = parse_value; if (print_value) node->print_value = print_value; if (compute_value) -- 2.30.2